package com.hl.sfzy.service.myService;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hl.sfzy.entity.my.MyNotify;
import com.hl.sfzy.mapper.my.MyNotifyMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MyNotifyService {
    @Autowired
    private MyNotifyMapper myNotifyMapper;

    //查看我的通知
    public  PageInfo<MyNotify> myNotifyList(int pageNo,int pageSize){
        PageHelper.startPage(pageNo,pageSize);
        List<MyNotify> myNotifies = myNotifyMapper.myNotifyList(pageNo, pageSize);

        PageInfo<MyNotify> myNotifyPageInfo = new PageInfo<>(myNotifies);
        return myNotifyPageInfo;
    }


    //添加通知
    public int addMyNotify(MyNotify myNotify){
        return myNotifyMapper.addMyNotify(myNotify);
    }

    public int deleteMyNotify(int id) {
        return myNotifyMapper.deleteMyNotify(id);
    }

    public int updateMyNotify(MyNotify myNotify) {

        return myNotifyMapper.updateMyNotify(myNotify);
    }

}
